#递归函数案例
#求n的阶乘
result=1
n = int(input("请输入数字"))
while n>0 :
    result=result*n
    n=n-1
print(result)

def diGui(n):
    if n>1:
        return n*diGui(n-1)
    else:
        return 1
print(diGui(5))

goodsList = [{"name":"快乐肥宅水","price":"3.0"},
             {"name":"茉莉清茶","price":"2.0"},
             {"name":"红茶","price":"4.0"}]
def searchGoods(goodsName):
    for goods in goodsList:
        if goods["name"] == goodsName:
            return goods
    return None
print(searchGoods("快乐肥宅水"))
print(searchGoods("快乐肥宅"))
